<!--
 * @Author: 260156 260156@gree.com.cn
 * @Date: 2022-10-24 11:26:13
 * @LastEditors: 260156 260156@gree.com.cn
 * @LastEditTime: 2022-11-04 17:09:49
 * @FilePath: \gree-zst-web\src\components\download_template\DownloadTemplate.vue
 * @Description: 
 * 
 * Copyright (c) 2022 by 260156 260156@gree.com.cn, All Rights Reserved. 
-->
<template>
  <el-button type="primary" @click="handleDownload"
    ><slot>下载模板</slot></el-button
  >
</template>

<script lang="ts" setup>
const props = defineProps<{ fileName: string }>();

const handleDownload = () => {
  location.href = new URL(
    `/files/${props.fileName}.xlsx`,
    import.meta.url
  ).href;
};
</script>
